package com.coocaa.ops.plus.dashboard.v1.internalapimgr;

import com.coocaa.ops.common.core.base.model.R;
import com.coocaa.ops.plus.dashboard.v1.internalapimgr.model.RequestModel;
import com.coocaa.ops.plus.dashboard.v1.internalapimgr.service.IThirdApiRequestService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;

/**
 * @author bijiahao
 * @description
 * @date 2020/2/18 10:46
 */
@RestController
@RequestMapping("/v1")
public class InternalApiMgrController {
    @Autowired
    private IThirdApiRequestService thirdApiRequestService;

    @RequestMapping("/thirdApi")
    public R thirdApi(HttpServletRequest request, RequestModel requestModel) {
        String result = thirdApiRequestService.getResponse(requestModel);
        return R.ok().data(result);
    }
}
